<template>
    <div>
        <div class="task-list">
            <br/>
            <div class="box" v-for="(taskInfo,index) in taskInfo" :key="index">
                <div class="task-top">
                    <h4>{{taskInfo.task_title}}</h4>
                    <div class="right">
                        <span>¥</span>
                        <span class="number_font">{{taskInfo.task_cash | formatNum}}</span>
                    </div>
                </div>
                <div class="addr-time">
                    <span>{{taskInfo.task_addr}} | {{taskInfo.task_cycle}}</span>
                    <span>{{taskInfo.start_time}}</span>
                </div>
                <div class="tag"><span>{{taskInfo.tag}}</span></div>
                <div>
                    <i class="zx-icon dot dot1">&#xe6cf;</i>
                    <span class="text">要求：</span>
                    <span class="con">{{taskInfo.task_require}}</span>
                </div>
                <div>
                    <i class="zx-icon dot dot2">&#xe6cf;</i>
                    <span class="text">周期：</span>
                    <span class="con">3天</span>
                </div>
                <div class="settext">
                    <i class="zx-icon dot dot3">&#xe6cf;</i>
                    <span class="text">描述：</span>
                    <span class="con con3">{{taskInfo.task_des}}</span>
                </div>
                <div class="conpany-info">
                    <img :src="taskInfo.headimgurl" alt="">
                    <div>
                        <h5>{{taskInfo.nickname}}</h5>
                        <!--<span>已认证 | 企业用户</span>-->
                    </div>
                </div>
            </div>
            <div v-if="taskInfo.length==0" style="text-align: center;padding-top: 30px;">
                <p><i style="font-size: 40px;color:#9a9a9a;" class="zx-icon">&#xe724;</i></p>
                <p style="font-size: 16px;color: #9a9a9a;">暂无数据</p>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
          return{
              taskInfo:''
          }
        },
        created(){
          this.getJobSignIng()
        },
        methods:{
            getJobSignIng(){
                let uid = '';
                if(localStorage.getItem('user')){
                    uid=JSON.parse(localStorage.getItem('user')).uid;
                }
                if(!uid){
                    this.$toast({message:'您尚未的登录'})
                    return
                };
                this.$post('/api/task/jobSigning',{uid:JSON.parse(localStorage.getItem('user')).uid}).then(res=>{
                    if(res.data.err_code == 0 ){
                        this.taskInfo = res.data.data;
                    }else{
                        console.log(res.data.err_msg)
                    }
                }).catch(err=>{
                    console.log(err)
                })
            }
        }
    }
</script>

<style lang="less" scoped>
    @import '../../../public/css/task-list.less';
    .box{
        background: #fff url("../../../public/img/siging.svg") no-repeat top right !important;
    }

</style>
